package com.example.mybank.aop;

import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class JsonResultAopLog {
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    //定义切点
    @Pointcut("execution(public * com.example.mybank.tool.JsonResult.*(..))")
    public void aopWebLog() {
    }

    @AfterReturning(pointcut = "aopWebLog()",returning = "retObject")
    public void doAfterReturning(Object retObject) throws Throwable {
        // 处理完请求，返回内容
        logger.info("JsonResult : " + retObject);
    }
}